package cn.edu.nju.software.zp13.core.nodeGenerator;

import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.Element;

import cn.edu.nju.software.zp13.core.nodeDescriptor.NodeDescriptor;

public class AttributeNodeGenerator extends NodeGenerator{

	public AttributeNodeGenerator(Document dom) {
		super(dom);
	}

	@Override
	public void updateDom(Node node, NodeDescriptor descriptor) {
		Attr attr=dom.createAttribute(descriptor.getNodeName());
		attr.setValue(getTextNodeContent(descriptor));
		((Element)node).setAttributeNode(attr);
	}

}
